<template>
	<div class="tobinput">
		<input type="text" placeholder="请输入代办事项，点击回车键" v-on:keyup.enter="addtob">
	</div>
</template>
<script>
	export default {
		name:'TobInput',
		props:{
			addtobobj:{
				type:Function
			}
		},
		methods:{
			addtob(e){
				const tob = {id:'4',name:e.target.value,done:false}
				this.addtobobj(tob)
			}
		},
		mounted(){
			console.log(this.addtobobj)
		}
	}
</script>
<style scoped>
	.tobinput{
		margin: 5px
	}
	.tobinput input{
		width: 97%
	}
</style>